<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>	
<%@page import="com.yaodian100.mall.member.util.UserData"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 	
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<%@page import="com.yaodian100.ec.product.entity.Product"%>
<%@page import="java.math.BigDecimal"%>
<%@taglib prefix="pu" uri="/WEB-INF/tld/pageutil.tld" %>
<link rel="stylesheet" href="/css/yaodian100_ordercar_v2.css" type="text/css" media="screen" />
 <script language="javascript">
$().ready(function(){
	$("#dialog").dialog({
		bgiframe: true,
		height: 700,
		width:700,
		modal: true,
		overlay: { opacity: 0.5, background: "black" }
	});
	$("#submitDialog").click(function(){	
		closeDialog('dialogWeight');
	});
});
</script>
<div id="dialog" class="od-detail d-show"> 
  <table class="tb-2"> 
    <thead> 
      <tr> 
        <th width="345">商品名称</th>
        <th width="50">类型</th>
        <th width="85">重量</th>
        <th width="50">数量</th>
        <th width="85">小计</th>
      </tr> 
    </thead> 
    <tbody> 
    	<c-rt:forEach items="${cartOrders.cartOrderProducts }" var="op" varStatus="opStatus">
				<c-rt:if test="${op.prodTp=='6' }">
         	<tr>
           	<td colspan="5" align="left" class="table-in">
           		<table border="0">
               	<tr>
                  <td width="345"><p>${op.prodName}</p></td>
                  <td width="50"><span class="type-0">主商品</span></td>
                  <td width="85"></td>
                  <td width="50" class="txt-price">1</td>
                  <td width="85"></td>
                </tr>
                <c-rt:forEach items="${op.details}" var="opd">
                	<c-rt:if test="${opd.detailTp == '6' and opd.prodId ne op.prodId and opd.qty >= 1}">
	                	<c-rt:set value="${opd.detailTp},${opd.prodId}" var="mapKey"/>
	                	<tr>
		                  <td width="345" class="txt-gy"><p>${opd.prodName}</p></td>
		                  <td width="50"><span class="type-4">活动</span></td>
		                  <td width="85">${resultMap[mapKey]}</td>
		                  <td width="50">${opd.qty}</td>
		                  <td width="85" class="txt-gy"><fmt-rt:formatNumber value="${resultMap[mapKey]*opd.qty}" pattern="#######0.000"/></td>
	                	</tr>
                	</c-rt:if>
               	</c-rt:forEach>
               </table>
            </td>
         	</tr>
        </c-rt:if>
     		<c-rt:if test="${op.prodTp=='0' or op.prodTp=='1' }">
	       	<tr>
	          <td colspan="5" align="left" class="table-in">
	          	<c-rt:forEach items="${op.details}" var="opd">
		          	<c-rt:if test="${opd.qty >= 1}">
			            <table border="0">
			            	<c-rt:if test="${opd.detailTp == '0' or opd.detailTp == '1'}">
			            		<c-rt:set value="${opd.detailTp},${opd.prodId}" var="mapKey"/>
			                <tr>
			                  <td width="345"><p>${opd.prodName}</p></td>
			                  <td width="50">
			                  	<c-rt:if test="${op.prodTp == '0'}">
			                  		<span class="type-0">主商品</span>
			                  	</c-rt:if>
			                  	<c-rt:if test="${op.prodTp == '1'}">
			                  		<span class="type-1">预购</span>
			                  	</c-rt:if>
			                  </td>
			                  <td width="85" class="txt-price">${resultMap[mapKey]}</td>
			                  <td width="50" class="txt-price">${opd.qty}</td>
			                  <td width="85"><fmt-rt:formatNumber value="${resultMap[mapKey]*opd.qty}" pattern="#######0.000"/></td>
			                </tr>
			               </c-rt:if>
			               <c-rt:if test="${opd.detailTp == '2'}">
			               	<c-rt:set value="${opd.detailTp},${opd.prodId}" var="mapKey"/>
				             	<tr>
			                  <td width="345" class="txt-gy"><p>${opd.prodName}</p></td>
			                  <td width="50"><span class="type-2">赠品</span></td>
			                  <td width="85" class="txt-price">${resultMap[mapKey]}</td>
			                  <td width="50" class="txt-gy">${opd.qty}</td>
			                  <td width="85"><fmt-rt:formatNumber value="${resultMap[mapKey]*opd.qty}" pattern="#######0.000"/></td>
			               	</tr>
			               </c-rt:if>
			               <c-rt:if test="${opd.detailTp == '3'}">
			               	<c-rt:set value="${opd.detailTp},${opd.prodId}" var="mapKey"/>
			               	<tr>
			                  <td width="345" class="txt-gy"><p>${opd.prodName}</p></td>
			                  <td width="50"><span class="type-3">加购</span></td>
			                  <td width="85" class="txt-price">${resultMap[mapKey]}</td>
			                  <td width="50" class="txt-gy">${opd.qty}</td>
			                  <td width="85"><fmt-rt:formatNumber value="${resultMap[mapKey]*opd.qty}" pattern="#######0.000"/></td>
			                	</tr>
			               </c-rt:if>
			            </table>
		            </c-rt:if>
	           </c-rt:forEach>
	         </td>
	       </tr>
     	 </c-rt:if>
			 <c-rt:if test="${op.prodTp=='5' }">
			 	<c-rt:set value="${op.prodTp},${op.prodId}" var="mapKey"/>
         	<tr>
           	<td colspan="5" align="left" class="table-in">
           		<table border="0">
               	<tr>
                  <td width="345"><p>${op.prodName}</p></td>
                  <td width="50"><span class="type-5">满额购</span></td>
                  <td width="85" class="txt-price">${resultMap[mapKey]}</td>
                  <td width="50" class="txt-price">1</td>
                  <td width="85"><fmt-rt:formatNumber value="${resultMap[mapKey]}" pattern="#######0.000"/></td>
                </tr>
               </table>
            </td>
         	</tr>
        </c-rt:if>     	         
     	</c-rt:forEach>
     	<tr>
		  	<td height="30" colspan="5"><div class="t-p txt-L"><strong>重量总计：<span class="txt-rd">
		          ${resultMap['totalWeight']}kg</span></strong></div></td>
	    </tr>
    </tbody>
  </table>
  <div class="show-weight-note"><p><strong>商品重量说明：</strong></p><p>商品重量的计算方式，是包含商品本身、商品配件(例如电饭煲的配件是电源线)、及商品包材(例如保护套、物流箱) 的总和。购物车中的重量总计，是将所有商品重量做加总。<br><br>配送运费则根据订单总重量及收货地区，而收取不同的费用。</p></div>
	<p align="center" style="margin:10px 0;"><a id="submitDialog" href="javascript:;" class="btn-mid">关闭</a></p>  
</div>